﻿var fs = require("fs");
var pako = require('pako');
var path = require('path')

var decode = function() {
	let result = fs.readFileSync("pakogame.cfg");
	let buffer = JSON.parse(pako.inflate(result, { to: 'string' }));
	console.log(Object.keys(buffer).length)
	for(var key in buffer){
		console.log(key)
		var arr = key.split("_");
		var contents = buffer[key]
		fs.writeFileSync("decode/" + arr[0] + "." + arr[1], contents);
	}
}

decode()